home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 436_01 / indemlib.mak < prev    next >
Text File  |  1994-10-07  |  5KB  |  170 lines

  1. #==========================================================================
  2. # INDEMLIB.MAK
  3. #
  4. # Creates INDEMO.EXE using INCONx.LIB.
  5. #
  6. # MAKE.EXE doesn't support redirection on ECHO, so this file calls
  7. # INDEMRSP.BAT to create the response file, INDEMLIB.RSP, required
  8. # by TLIB.  If INDEMRSP.BAT is not available, you can recreate
  9. # it from the following comments.
  10. #
  11. # ::INDEMRSP.BAT
  12. # echo off
  13. # set op=%path%
  14. # path=%1
  15. # for %%x in (INDEMLIB INDEMO) do if "%%x"=="%path%" goto :%%x
  16. # path=%0
  17. # echo %path%.BAT is meant to be called by INDEMLIB.MAK or INDEMO.MAK...
  18. # goto :EXIT
  19. # :INDEMLIB
  20. # echo Creating %1.rsp ...
  21. # echo -+incon    & >  %1.rsp
  22. # echo -+inalpha  & >> %1.rsp
  23. # echo -+infloat  & >> %1.rsp
  24. # echo -+inintgr  & >> %1.rsp
  25. # echo -+intempl  & >> %1.rsp
  26. # echo -+inutil   & >> %1.rsp
  27. # echo -+stringz    >> %1.rsp
  28. # goto :EXIT
  29. # :INDEMO
  30. # for %%x in (s m c l S M C L) do if "%%x"=="%2" goto :OK
  31. # echo Requires memory model (s, m, c, or l)
  32. # goto :EXIT
  33. # :OK
  34. # echo Creating %1.rsp ...
  35. # echo \tc\lib\c0%2+ >  %1.rsp
  36. # echo indemo%2    + >> %1.rsp
  37. # echo inhelp%2    + >> %1.rsp
  38. # echo incon%2     + >> %1.rsp
  39. # echo inalpha%2   + >> %1.rsp
  40. # echo infloat%2   + >> %1.rsp
  41. # echo inintgr%2   + >> %1.rsp
  42. # echo intempl%2   + >> %1.rsp
  43. # echo inutil%2    + >> %1.rsp
  44. # echo addattr    +  >> %1.rsp
  45. # echo stringz       >> %1.rsp
  46. # :EXIT
  47. # path=%op%
  48. # set op=
  49. #==========================================================================
  50. #
  51. # TCC options are:
  52. #  -c    compile to OBJ
  53. #  -d    merge duplicate strings
  54. #  -f-   no floating point
  55. #  -G    optimize for speed
  56. #  -I    include directories
  57. #  -L    library directories
  58. #  -mx   memory model x
  59. #  -N    check stack overflow
  60. #  -O    jump optimization
  61. #  -o    name object file
  62. #  -r    use register variables
  63. #  -S    compile to ASM
  64. #  -v    source debugging on
  65. #  -w    display all warnings
  66. #  -y    line numbers in OBJ
  67. #  -Z    register optimization
  68. #
  69. # TASM options are:
  70. #  /ml   all symbols case sensitive
  71. #  /t    suppress messages if assembly ok
  72. #  /w2   enable warning messages
  73. #  /z    display source line w/error message
  74. #
  75. # TLINK options are:
  76. #  /c    case significant
  77. #  /d    warn duplicate symbols
  78. #  /m    map file w/public symbols
  79. #  /v    debugging info in .exe file
  80. #==========================================================================
  81.  
  82. # If memory model not defined, use large.
  83.  
  84. !if !$d(MDL)
  85. MDL=l
  86. !endif
  87.  
  88. # Define paths for Turbo C and output directories.  Make changes to these
  89. # constants if your directory structure is set up differently.
  90.  
  91. TCC      = \tc\tcc                     # path to TCC.EXE
  92. TASM     = \tasm\tasm                  # path to TASM.EXE
  93. TLIB     = \tc\tlib                    # path to TLIB.EXE
  94. TLINK    = \tc\tlink                   # path to TLINK.EXE
  95. I_DIR    = \tc\inc;\tc\inc\sys         # include directory
  96. L_DIR    = \tc\lib\                    # library directory
  97.  
  98. # Object and library modules required to make INDEMO.EXE.
  99.  
  100. STARTUP  = $(L_DIR)c0$(MDL)
  101. OBJS     = $(STARTUP) indemo inhelp addattr
  102. LIBS     = incon$(MDL) $(L_DIR)emu $(L_DIR)math$(MDL) $(L_DIR)c$(MDL)
  103.  
  104. # Compiler, linker, assembler options.
  105.  
  106. !if $d(DEBUG)
  107. C_OPTS   = -c -d -f- -G -I$(I_DIR) -m$(MDL) -N -O -r -w -v -y -Z
  108. L_OPTS   = /c/d/m/v
  109. !else
  110. C_OPTS   = -c -d -f- -G -I$(I_DIR) -m$(MDL) -O -r -w -Z
  111. L_OPTS   = /c/d/m
  112. !endif
  113. A_OPTS   = /ml/t/w2/z
  114.  
  115. # Compile and link commands.
  116.  
  117. COMPILE  = $(TCC) $(C_OPTS)
  118. LINK     = $(TLINK) $(L_OPTS)
  119.  
  120. # Common header files.
  121.  
  122. H_FILES  = indecl.h indefs.h
  123.  
  124. # Object files for INCON.LIB.
  125.  
  126. INLIB    = incon.obj inalpha.obj infloat.obj inintgr.obj intempl.obj  \
  127.            inutil.obj stringz.obj
  128.  
  129. # Create INDEMO.EXE.
  130.  
  131. indemo.exe:  indemo.obj inhelp.obj addattr.obj incon$(MDL).lib
  132.    $(LINK) $(OBJS), indemo, indemo, $(LIBS)
  133.  
  134. # Create INCON.LIB.
  135.  
  136. incon$(MDL).lib: $(INLIB)
  137.    indemrsp indemlib                   # call INDEMRSP.BAT
  138.    $(TLIB) incon$(MDL) @indemlib.rsp
  139.    del indemlib.rsp
  140.  
  141. # The compiler command lines below include a macro defined by
  142. # Borland's MAKE.EXE that allows use of switches stored in
  143. # environment variables.  The macros below all reference an
  144. # environment variable named X, defined by "set x=text_string".
  145.  
  146. indemo.obj: indemo.c $(H_FILES)
  147.    $(COMPILE) -f $(X) indemo                      # needs floating-point
  148.  
  149. inhelp.obj: inhelp.c addattr.h indefs.h
  150.    $(COMPILE) $(X) inhelp
  151.  
  152. incon.obj: incon.c incon.h $(H_FILES) instats.h stringz.h
  153.    $(COMPILE) $(X) incon
  154.  
  155. .c.obj:
  156.    $(COMPILE) $(X) $<
  157.  
  158. .asm.obj:
  159.    $(TASM) $(A_OPTS) $<;
  160.  
  161. inalpha.obj: $(H_FILES) incon.h
  162. infloat.obj: $(H_FILES) incon.h
  163. inintgr.obj: $(H_FILES) incon.h
  164. intempl.obj: $(H_FILES) incon.h
  165. inutil.obj : $(H_FILES)
  166. addattr.obj: addattr.h
  167. stringz.obj: stringz.h
  168.  
  169. #### EOF:  INDEMLIB.MAK ####
  170.